﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using GSLMS.Entity;
namespace GSLMS.Services.Interface
{
	/// <summary>
	/// 接口说明:TB_SYS_EMP接口
	/// </summary>
	[ServiceContract(Name = "ISYS_EMP", Namespace = "http://www.gslms.com/")]
	public interface ISYS_EMP : IBase<TB_SYS_EMP>
	{
        /// <summary>
		///  增加一条数据,-1用户名已经存在，1成功，0失败
		/// </summary>
        [OperationContract]
        int AddEmp(GSLMS.Entity.TB_SYS_EMP model);

        /// <summary>
        ///  更新一条数据,-1用户名已经存在，1成功，0失败
		/// </summary>
        [OperationContract]
        int UpdateEmp(GSLMS.Entity.TB_SYS_EMP model);

        /// <summary>
        /// 解冻用户/冻结用户
        /// </summary>
        /// <param name="ID">职员记录ID</param>
        /// <param name="userStatus">用户状态，1解冻，0冻结</param>
        /// <returns></returns>
        [OperationContract]
        bool LockOrUnLockUser(long ID, int userStatus);

        /// <summary>
        /// 修改登录密码
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <param name="pwd">MD5原密码</param>
        /// <param name="newPwd">MD5新密码</param>
        /// <returns>-1用户不存在,-2原密码输入不正确，1成功，0失败</returns>
        [OperationContract]
        int UpdatePwd(string userName, string pwd, string newPwd);

        /// <summary>
        /// 修改登录密码
        /// </summary>
        /// <param name="ID">职员记录ID</param>
        /// <param name="newPwd">MD5新密码</param>
        /// <returns>-1用户不存在,1成功，0失败</returns>
        [OperationContract]
        int ResetPwd(long ID, string newPwd);
       

        /// <summary>
        /// 验证用户登录
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <param name="pwd">MD5加密密码</param>
        /// <returns></returns>
        [OperationContract]
        GSLMS.Entity.TB_SYS_EMP CheckLogin(string userName, string pwd);


        /// <summary>
        /// 更新最新登录时间
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <returns></returns>
        [OperationContract]
        bool UpdateLastLoginDate(string userName);


        /// <summary>
        /// 提取所有职员信息
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        List<GSLMS.Entity.TB_SYS_EMP> GetAllEmp();

        /// <summary>
        /// 提取所有未离职员信息
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        List<GSLMS.Entity.TB_SYS_EMP> GetEffAllEmp();


        /// <summary>
        /// 通过用户名获取用户信息
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <returns></returns>
        [OperationContract]
        GSLMS.Entity.TB_SYS_EMP GetByUserName(string userName);

        /// <summary>
        /// 提取所有业务员信息,包含已经离职、休假的业务员
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        List<GSLMS.Entity.TB_SYS_EMP> GetSalesAllList();


        /// <summary>
        /// 提取所有有效业务员信息,不包含已经离职业务员
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        List<GSLMS.Entity.TB_SYS_EMP> GetSalesEffList();

        /// <summary>
        /// 提取所有用户信息,包含已经离职和休假的用户
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        List<GSLMS.Entity.TB_SYS_EMP> GetUserAllList();

        /// <summary>
        /// 提取所有用户信息,不包含已经离职用户
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        List<GSLMS.Entity.TB_SYS_EMP> GetUserEffList();

        /// <summary>
        /// 提取所有用户信息,不包含已经离职、已经休假的用户
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        List<GSLMS.Entity.TB_SYS_EMP> GetUserWorkList();

        /// <summary>
        /// 提取拥有某种权限的所有用户信息,包含已经离职、已经休假的用户
        /// </summary>
        /// <param name="modelID">模块记录ID，如：Employee等</param>
        /// <param name="operType">操作标识符，如：ADD,ADU等</param>
        /// <returns></returns>
        [OperationContract]
        List<GSLMS.Entity.TB_SYS_EMP> GetUserPrivAllList(string modelID, string operType);

        /// <summary>
        /// 提取拥有某种权限的所有用户信息,不包含已经离职的用户
        /// </summary>
        /// <param name="modelID">模块记录ID，如：Employee等</param>
        /// <param name="operType">操作标识符，如：ADD,ADU等</param>
        /// <returns></returns>
        [OperationContract]
        List<GSLMS.Entity.TB_SYS_EMP> GetUserPrivEffList(string modelID, string operType);

        /// <summary>
        /// 提取拥有某种权限的所有用户信息,不包含已经离职、已经休假的用户
        /// </summary>
        /// <param name="modelID">模块记录ID，如：Employee等</param>
        /// <param name="operType">操作标识符，如：ADD,ADU等</param>
        /// <returns></returns>
        [OperationContract]
        List<GSLMS.Entity.TB_SYS_EMP> GetUserPrivWorkList(string modelID, string operType);

        /// <summary>
        /// 提取有风控审批权限的用户信息
        /// </summary>
        /// <param name="actionBy">查询人或是分配人，会提取同等级及其下级有风控审批权限的用户信息</param>
        /// <returns></returns>
        [OperationContract]
        List<GSLMS.Entity.TB_SYS_EMP> GetRiskAuditUserList(string actionBy);

	}
}
